class {
  onCreate() {
    this.state = { count: 0 };
  }
  increment() {
    this.state.count++;
  }
}
<button onClick("increment")>
  ${state.count}
</button>